package com.jxnd.sunflower.exception;

import lombok.Data;

/**
 * @author: 敷衍
 * @description: 统一的异常处理
 * @date: 2021/11/22 16:12
 * @version: 1.0
 */
@Data
public class SunFlowerException extends RuntimeException{

    // 消息
    private String msg;
    //状态码
    private int code;

    public SunFlowerException(String msg) {
        super(msg);
        this.msg = msg;
    }

    public SunFlowerException(String msg, Throwable e) {
        super(msg, e);
        this.msg = msg;
    }

    public SunFlowerException(String msg, int code) {
        super(msg);
        this.msg = msg;
        this.code = code;
    }


    public SunFlowerException(String msg, Throwable e, int code) {
        super(msg, e);
        this.code = code;
        this.msg = msg;
    }
}
